import { useResponseSuccess } from '~/utils/response';

export default eventHandler(async (event) => {
  const body = await readBody(event);

  // 模拟创建模板
  const newTemplate = {
    id: Date.now().toString(),
    ...body,
    createTime: new Date().toISOString().replace('T', ' ').substring(0, 19),
    updateTime: new Date().toISOString().replace('T', ' ').substring(0, 19),
  };

  return useResponseSuccess({
    message: '创建成功',
    data: newTemplate,
  });
});
